|
Server : LiteSpeed System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : idnco5810 ( 1093) PHP Version : 8.2.29 Disable Function : NONE Directory : /snap/core20/current/lib/python3/dist-packages/cloudinit/cmd/devel/ |
Upload File : |
# This file is part of cloud-init. See LICENSE file for license information.
"""Common cloud-init devel command line utility functions."""
from cloudinit.helpers import Paths
from cloudinit.stages import Init
def read_cfg_paths(fetch_existing_datasource: str = "") -> Paths:
"""Return a Paths object based on the system configuration on disk.
:param fetch_existing_datasource: String one of check or trust. Whether to
load the pickled datasource before returning Paths. This is necessary
when using instance paths via Paths.get_ipath method which are only
known from the instance-id metadata in the detected datasource.
:raises: DataSourceNotFoundException when no datasource cache exists.
"""
init = Init(ds_deps=[])
if fetch_existing_datasource:
init.fetch(existing=fetch_existing_datasource)
init.read_cfg()
return init.paths